// stores/counter.js
import {
	defineStore
} from 'pinia'
import {
	ref,
	reactive
} from 'vue'

export const useEquityStore = defineStore('eqityId', () => {
	// 状态数据（相当于 state）
	const userInfo = reactive({
		username: "",
		mobile: null,
		pageName: "",
		data: [],
	})
	/* 数据 死的 */
	const noLoginEqityData = reactive({
		internetRights: {
			title: '互联网权益',
			list: [{
					subTitle: "视频类权益",
					icon: "/sxzz/iconPlay.png",
					cardItem: [{
						vipIcon: "/sxzz/tengXun.png",
						vipTitle: "腾讯会员视频月卡",
						button: "/sxzz/icon_get.png"
					}, {
						vipIcon: "/sxzz/youKu.png",
						vipTitle: "优酷会员视频月卡",
						button: "/sxzz/icon_get.png"
					}, {
						vipIcon: "/sxzz/aiQiYi.png",
						vipTitle: "爱奇艺会员视频月卡",
						button: "/sxzz/icon_get.png"
					}, {
						vipIcon: "/sxzz/souHu.png",
						vipTitle: "搜狐会员视频月卡",
						button: "/sxzz/icon_get.png"
					}, {
						vipIcon: "/sxzz/miGu.png",
						vipTitle: "咪咕会员视频月卡",
						button: "/sxzz/icon_get.png"
					}, {
						vipIcon: "/sxzz/mengGuo.png",
						vipTitle: "芒果会员视频月卡",
						button: "/sxzz/icon_get.png"
					}]
				},
				{
					subTitle: "工具类权益",
					icon: "/sxzz/icon_tool_n.png",
					cardItem: [{
						vipIcon: "/sxzz/listen.png",
						vipTitle: "喜马拉雅会员月卡",
						button: "/sxzz/icon_get.png"
					}, {
						vipIcon: "/sxzz/keep.png",
						vipTitle: "Keep会员月卡",
						button: "/sxzz/icon_get.png"
					}, {
						vipIcon: "/sxzz/story.png",
						vipTitle: "互动小说会员月卡",
						button: "/sxzz/icon_get.png"
					}, {
						vipIcon: "/sxzz/changLong.png",
						vipTitle: "长龙航空会员月卡",
						button: "/sxzz/icon_get.png"
					}, {
						vipIcon: "/sxzz/studyKing.png",
						vipTitle: "学王课堂会员月卡",
						button: "/sxzz/icon_get.png"
					}]
				}
			]
		},
		selfProducts:{
				title: '自营产品权益',
				list:[
					{
						subTitle: null,
						icon: null,
						cardItem: [{
							vipIcon: "/sxzz/metro.png",
							vipTitle: "广州地铁权益",
							button: "/sxzz/icon_get.png"
						}, {
							vipIcon: "/sxzz/jiePark.png",
							vipTitle: "捷停车权益",
							button: "/sxzz/icon_get.png"
						}, {
							vipIcon: "/sxzz/shengXin.png",
							vipTitle: "省心App权益",
							button: "/sxzz/icon_get.png"
						}, {
							vipIcon: "/sxzz/park.png",
							vipTitle: "捷停车权益",
							button: "/sxzz/icon_get.png"
						}]
					}
				]
		},
		carOwnerProducts:{
			title: '车主产品权益',
			list:[
				{
					subTitle: null,
					icon: null,
					cardItem: [{
						vipIcon: "/sxzz/tuanyou 1.png",
						vipTitle: "团油App权益",
						button: "/sxzz/icon_get.png"
					}, {
						vipIcon: "/sxzz/jiePark.png",
						vipTitle: "捷停车权益",
						button: "/sxzz/icon_get.png"
					}]
				}
			]
		},
		liJianjinEquity:{
			title: '立减金权益',
			list:[
				{
					subTitle: null,
					icon: null,
					cardItem: [{
						vipIcon: "/sxzz/zfb.png",
						vipTitle: "支付宝立减金",
						button: "/sxzz/icon_get.png"
					}, {
						vipIcon: "/sxzz/wx_coupon.png",
						vipTitle: "微信立减金",
						button: "/sxzz/icon_get.png"
					}]
				}
			]
		}
	})
	const setUserName = (data) => {
		console.log(data);
		userInfo.username = data
	}


	// 一定要将定义的数据和方法返回
	return {
		setUserName,
		userInfo,
		noLoginEqityData
	}
}, {
	persist: {
		paths: ['userInfo'],
		// storage:sessionStorage
	}
})